package com.yugao.fintech.antelope.member.model.rqrs.level;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yugao.fintech.antelope.member.model.entity.MemberLevel;
import com.yugao.fintech.antelope.base.model.constants.ValidationCons;
import com.yugao.fintech.antelope.base.model.enums.BoolEnum;
import com.yugao.fintech.antelope.base.model.module.dict.CusFieldBind;
import com.yugao.fintech.antelope.base.model.module.dict.DictTypeCons;
import com.yugao.fintech.framework.core.json.BooleanDeserializer;
import com.yugao.fintech.framework.core.json.BooleanNumberSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * 会员等级
 *

 */
@Getter
@Setter
public class MemberLevelBase {
	@NotEmpty(message = ValidationCons.NOT_EMPTY)
 	@ApiModelProperty(value = "会员名称")
	private String name;
	
 	@ApiModelProperty(value = "等级权重, 数字越大 等级越高")
	@NotEmpty(message = ValidationCons.NOT_EMPTY)
	@CusFieldBind(target = "weightName", type = DictTypeCons.MEMBER_LEVEL_WEIGHT)
	private String weight;
	private String weightName;

 	@ApiModelProperty(value = "背景图片")
	private String backgroundUrl;
	
 	@ApiModelProperty(value = "升级条件, 满足条件后自动升级, eg: expendMoney = 100")
	private MemberLevel.Upgrade upgrade;

	@ApiModelProperty(value = "是否为默认等级：0;不是；1;是")
	@NotNull(message = ValidationCons.NOT_EMPTY)
	@JsonSerialize(using = BooleanNumberSerializer.class)
	@JsonDeserialize(using = BooleanDeserializer.class)
	private Boolean isDefault;
	
 	@ApiModelProperty(value = "免运费标准")
	private BigDecimal freeFreightPoint;
	
 	@ApiModelProperty(value = "每次评价获取的成长值")
	private Integer commentGrowthPoint;
	
 	@ApiModelProperty(value = "消费折扣权益,  0: 不打折, 9.8代表98折")
	private BigDecimal equityConsumeDiscount;
	
 	@ApiModelProperty(value = "积分回馈倍率权益, 回馈积分 = 消费金额 * 积分回馈倍率")
	private BigDecimal equityPointFeedback;
	
 	@ApiModelProperty(value = "是否有免邮权益")
	private Boolean equityFreeFreight;
	
 	@ApiModelProperty(value = "是否有签到权益")
	private Boolean equitySignIn;
	
 	@ApiModelProperty(value = "是否有评论获奖励权益")
	private Boolean equityComment;
	
 	@ApiModelProperty(value = "是否有专享活动权益")
	private Boolean equityPromotion;
	
 	@ApiModelProperty(value = "是否有会员价格权益")
	private Boolean equityMemberPrice;
	
 	@ApiModelProperty(value = "是否有生日权益")
	private Boolean equityBirthday;
	
 	@ApiModelProperty(value = "赠送积分")
	private Integer sendPoint;
	
 	@ApiModelProperty(value = "赠送红包")
	private BigDecimal sendBalance;

	/**
	 * @see BoolEnum
	 */
	@ApiModelProperty(value = "状态, 0: 禁用, 1: 启用")
	private String status;

	@ApiModelProperty(value = "等级说明")
	private String remark;
}
